package com.sqx.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sqx.common.validator.group.AddGroup;
import com.sqx.common.validator.group.UpdateGroup;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.datacentre.entity.SysUserShop;
import com.sqx.modules.health.entity.Record;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 系统用户
 *
 */
@Data
@TableName("sys_user")
public class SysUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 用户ID
	 */
	@TableId(value = "user_id", type = IdType.AUTO)
	private Long userId;

	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String username;

	/**
	 * 密码
	 */
	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	private String password;

	/**
	 * 盐
	 */
	private String salt;

	/**
	 * 邮箱
	 */
	@NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	private String email;

	/**
	 * 手机号
	 */
	//private String phone;

	/**
	 * 状态  0：禁用   1：正常
	 */
	private Integer status;

	/**
	 * 角色ID列表
	 */
	@TableField(exist=false)
	private List<Long> roleIdList;

	/**
	 * 创建者ID
	 */
	private Long createUserId;

	/**
	 * 用户类型 1管理员 2商家管理员
	 */
	private Integer userType;


	/**
	 * 创建时间
	 */
	private Date createTime;

	@TableField(exist = false)
	private List<Long> shopIdList;

	@ApiModelProperty("角色集合")
	@TableField(exist = false)
	private List<SysUserRoleEntity> roleList;

	@ApiModelProperty("管理门店集合")
	@TableField(exist = false)
	private List<SysUserShop> shopList;

	@TableField(exist = false)
	private UserEntity userEntity;

	//private Long id;

	@ApiModelProperty("电话号码")
	private String phone;

	/*@ApiModelProperty("口令")
	private String password;*/

	@ApiModelProperty("0 患者 1医护 2运维")
	private Integer type;

	@ApiModelProperty("医院ID 0未定义所属医院，大于0只对于医护人员有意义")
	private Long hid;

	/*@ApiModelProperty("用户姓名")
	private String username;*/

	@ApiModelProperty("身份证号")
	private String cardid;

	@ApiModelProperty("家庭住址")
	private String address;

	@ApiModelProperty("用户昵称")
	private String nickName;

	@ApiModelProperty("用户头像")
	private String avatarUrl;

	@ApiModelProperty("用户性别 0未知 1男 2女")
	private Integer gender;

	@ApiModelProperty("国家")
	private String country;

	@ApiModelProperty("省份")
	private String province;

	@ApiModelProperty("城市")
	private String city;

	@ApiModelProperty("显示")
	private String language;

	@ApiModelProperty("登录token")
	private String token;

	private String openid;

	@ApiModelProperty("角色")
	private String role;

	@ApiModelProperty("用户是否需要检测")
	private String isdetection;

	@ApiModelProperty("标识(与代理商运营人员和医院医护人员进行绑定)")
	private String flag;

	@ApiModelProperty("用户拓展表标识(用户对应的拓展表信息)")
	private String expandflag;

	@ApiModelProperty("所属医生 --> 针对患者")
	private Long belongsDoctor;

	@ApiModelProperty("所属营养师 --> 针对患者")
	private Long belongsDietitian;

	@ApiModelProperty("患者年龄")
	private Integer age;

	@ApiModelProperty("患者身高(/CM)")
	private BigDecimal stature;

	@ApiModelProperty("患者体重(/kg)")
	private BigDecimal weight;

	@ApiModelProperty("疾病类型")
	private String diseaseType;

	@ApiModelProperty("既往病史")
	private String diseasehistory;

	@ApiModelProperty("是否重点用户")
	private Integer keynote;

	@ApiModelProperty("是否院内患者 1 院内")
	private Integer isinner;

	@ApiModelProperty("所属护士 --> 针对患者")
	private Long belongsNurse;

	@ApiModelProperty("医生姓名")
	private String belongsDoctorName;

	@ApiModelProperty("护士姓名")
	private String belongsNurseName;

	@ApiModelProperty("床位信息")
	private String bedinfo;

	@ApiModelProperty("住院时间")
	private String hospitalizationtime;

	@ApiModelProperty("出院")
	private Integer discharge;

	@ApiModelProperty("出院")
	private String imid;

	@ApiModelProperty("出院")
	private String imtoken;

	@ApiModelProperty("出院")
	private Long imtokenexpired;

	@ApiModelProperty("出院时间")
	private String dischargetime;

	@ApiModelProperty("疾病类型名称")
	@TableField(exist = false)
	private String diseaseName;

	@ApiModelProperty("所属医生姓名")
	@TableField(exist = false)
	private String doctorName;

	@ApiModelProperty("测量数据")
	@TableField(exist = false)
	private Record record;

}
